package com.smartHire.service.impl;

import com.smartHire.dao.ManagerDao;
import com.smartHire.domain.Manager;
import com.smartHire.service.ManagerService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.servlet.jsp.tagext.TryCatchFinally;
import java.util.List;

@Service("managerService")
public class ManagerServiceImpl implements ManagerService{
    @Resource(name = "managerDao")
    private ManagerDao managerDao;

    public void setManagerDao (ManagerDao managerDao) {this.managerDao=managerDao;}

    @Override
    public int addManager(Manager manager ){

        try {
            int nums = managerDao.inserManager(manager);
            return nums;
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
        return 0;
    }
    @Override
    public List<Manager> queryManager() {
        try {
            List<Manager> managers = managerDao.selectManager();
            return managers;
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
        return null;
    }
}
